interface Shape {
	public float volume();
}

interface Stretchable {
	public void resize(float factor);
}

abstract class Sphere implements Shape {
	private float R;

	abstract public String getColor();

	protected Sphere(float radius) {
		this.R = radius;
	}

	@Override
	public float volume() {
		return (float)(4.0f / 3.0f *
				Math.PI * Math.pow(this.R, 3));
	}

	@Override
	public String toString() {
		return this.getColor() +
			" sphere with a radius of " + this.R +
			" and a volume of " + this.volume();
	}
}

class Baseball extends Sphere {
	private boolean isOld, isSigned;

	public Baseball(boolean isOld, boolean isSigned) {
		this.isOld = isOld;
		this.isSigned = isSigned;
	}

	@Override
	public String getColor() {
		return (this.isOld ? "gray" : "white");
	}

	@Override
	public String toString() {
		return this.getColor() +
			" baseball with a radius of " + super.R;
	}
}

class Balloon extends Sphere implements Stretchable {
	private String color;

	public Balloon(String color, float radius) {
		super(radius);

		this.color = color;
	}

	@Override
	public String getColor() {
		return this.color;
	}

	@Override
		public void resize(float factor) {
		super.R = super.R * factor;
	}
}

public class TestAll {
	public static void main(String[] args) {
		Baseball baseball = new Baseball(false, true);
		Balloon balloon = new Balloon("blue", 3.0f);

		System.out.println(baseball);
		System.out.println(baseball.toString());

		System.out.println(balloon);

		balloon.resize(2);

		System.out.println(balloon);
	}
}
